package com.leet.meituan;

import java.security.KeyStore;
import java.util.*;

public class PaoTui {
    public static void main(String[] args) {
        // 记录总价值和序号
        TreeMap<Integer,Integer> sortMap = new TreeMap<>();
        Scanner sc = new Scanner(System.in);
        String[] nums = sc.nextLine().split(" ");
        int n = Integer.parseInt(nums[0]);
        int receive = Integer.parseInt(nums[1]);
        // 读入价格和重量
        for(int i = 0; i < n; i++){
            String[] s = sc.nextLine().split(" ");
            int price = Integer.parseInt(s[0]);
            int weight = Integer.parseInt(s[1]);
            sortMap.put(i+1,price+2*weight);
        }
        List<Map.Entry<Integer,Integer>> list = new ArrayList<>(sortMap.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<Integer, Integer>>() {
            @Override
            public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) {
                if(o2.getValue().compareTo(o1.getValue())!=0){
                    return o2.getValue().compareTo(o1.getValue());
                }else{
                    return o1.getKey().compareTo(o2.getKey());
                }
            }
        });
        List<Integer> ans = new ArrayList<>();
        for (int i = 0; i < receive; i++) {
            ans.add(list.get(i).getKey());
        }
        Collections.sort(ans);
        for(Integer a : ans){
            System.out.println(a+" ");
        }
    }
}
